package com.ruoyi.quartz.task;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.stock.service.IStockDfcfService;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component("GetDfcfData")
public class GetDfcfData {

    private IStockDfcfService stockDfcfService= SpringUtils.getBean(IStockDfcfService.class);

    public void getlastData() throws Exception {
        String dateBase= DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,new Date());
        Date minDate=DateUtils.parseDate(dateBase+" 9:00:00");
        Date maxDate=DateUtils.parseDate(dateBase+" 15:00:00");
       // stockDfcfService.insertStockDfcfAll();
        if(DateUtils.getNowDate().getTime()>minDate.getTime() && DateUtils.getNowDate().getTime()<maxDate.getTime()){
            stockDfcfService.insertStockDfcfAll();
        }else{
            System.out.println("不更新");
        }

    }

  //  private IStockDfcfService stockDfcfService = SpringUtils.getBean(IStockDfcfService.class);




}
